﻿<UserControl
    x:Class="WinRTXamlToolkit.Sample.Views.ListViewExtensionsTestView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Extensions="using:WinRTXamlToolkit.Controls.Extensions"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition
                Height="Auto" />
            <RowDefinition />
            <RowDefinition
                Height="Auto" />
            <RowDefinition
                Height="140" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBlock
            Text="SourceListView"
            Style="{StaticResource SubheaderTextStyle}" />
        <ListView
            x:Name="SourceListView"
            Grid.Row="1"
            ItemsSource="{Binding MyItems}"
            SelectionMode="Multiple"
            Extensions:ListViewExtensions.BindableSelection="{Binding SelectedItems, Mode=TwoWay}" />

        <TextBlock
            Text="TargetListView (BindableSelection)"
            Grid.Column="1"
            Style="{StaticResource SubheaderTextStyle}" />
        <ListView
            x:Name="TargetListView"
            ItemsSource="{Binding SelectedItems, Mode=TwoWay}"
            Grid.Row="1"
            Grid.Column="1" />

        <StackPanel
            Grid.Row="2"
            Orientation="Horizontal">
            <TextBlock
                Text="SelectedItem: "
                Margin="0,0,20,0"
                Style="{StaticResource SubheaderTextStyle}" />
            <TextBlock
                Text="{Binding SelectedItem, ElementName=SourceListView}"
                Style="{StaticResource SubheaderTextStyle}" />
        </StackPanel>
        <controls:CustomAppBar
            Grid.Row="3"
            Grid.ColumnSpan="2"
            CanDismiss="False">
            <StackPanel
                Orientation="Horizontal">
                <Button
                    Style="{StaticResource AddAppBarButtonStyle}"
                    Click="AddItem" />
            </StackPanel>
        </controls:CustomAppBar>
    </Grid>
</UserControl>
